import { Component, OnInit, ViewChild } from '@angular/core';
import { _HttpClient } from '@delon/theme';
import { STColumn, STComponent, STChange, STPage } from '@delon/abc/table';
import { SFSchema, SFComponent, SFRadioWidgetSchema } from '@delon/form';
import { HttpService, SupDic, GridComponent } from 'lbf';
import { ActivatedRoute } from '@angular/router';
import { NzMessageService } from 'ng-zorro-antd';
import { ReuseTabService } from '@delon/abc/reuse-tab';
import { LbStepsComponent } from '@shared/components/lb-steps/lb-steps.component';
import { LbWjfwComponent } from '@shared/components/lb_wjfw/lbwjfw.component';
import { isUndefined } from 'util';

@Component({
  selector: 'app-sybx-wjypo',
  templateUrl: './wjypo.component.html',
})
export class SybxWjypoComponent implements OnInit {
  tabs = ['办件信息', '材料影像'];
  dataset = [];
  date2: any = {}; //银行网点列表
  date3: any = {}; //医疗机构列表
  PROJID = '1';
  DAD069 = '';
  DAD017 = ''; //事项编码
  AAC002 = '';
  DAD095 = '';

  old_AMC029 = ''; //
  old_BMC031 = '';
  old_AMC028 = 0; //胎儿数
  old_AMC002 = ''; //生育类型
  LS_DAD017 = ''; //获取事项编码
  isPzVisible = false; //银行网点隐藏
  isPzVisible1 = false; //医疗机构隐藏

  params = { sname: 'BJXX_QUERY', queryparas: {} };

  slSchema: SFSchema = {
    properties: {
      DAD095: {
        type: 'string',
        title: '',
        enum: [
          { label: '受理', value: '1' },
          { label: '不受理', value: '0' },
        ],
        // tslint:disable-next-line: no-object-literal-type-assertion
        ui: {
          widget: 'radio',
          change: console.log,
          grid: {
            span: 24,
          },
        } as SFRadioWidgetSchema,
        default: '1',
      },
      DAD098: {
        type: 'string',
        title: '不予受理原因',
        ui: {
          visibleIf: { DAD095: ['0'] },
          spanLabelFixed: 80,
          grid: { span: 24 },
        },
      },
    },
    ui: { grid: { span: 24 } },
  };
  //生育申请录入信息
  sdSchema: SFSchema = {
    properties: {
      AAB301: {
        type: 'string',
        title: '参保地统筹区',
        enum: this.supDic.getSFDic('AAB301'),
        ui: {
          widget: 'select',
          allowClear: true,
          grid: { span: 6 },
        },
      },
      AAC002: {
        type: 'string',
        title: '社会保障号',
        ui: { grid: { span: 6 } },
      },
      AAC003: {
        type: 'string',
        title: '姓名',
        ui: { grid: { span: 6 } },
      },
      BMC131: {
        type: 'string',
        title: '计划生育日期',
        ui: {
          widget: 'date',
          allowClear: true,
          grid: { span: 6 },
        },
      },
      BMC132: {
        type: 'string',
        title: '末次月经时间',
        ui: {
          widget: 'date',
          allowClear: true,
          grid: { span: 6 },
        },
      },
      BMC030: {
        type: 'string',
        title: '计划生育类型',
        enum: this.supDic.getSFDic('BMC030'),
        ui: {
          widget: 'select',
          allowClear: true,
          grid: { span: 6 },
        },
      },
      AKC201: {
        type: 'string',
        title: '医疗机构类型',
        enum: this.supDic.getSFDic('AKC201'),
        ui: {
          widget: 'select',
          allowClear: true,
          grid: { span: 6 },
        },
      },
      AMC028: {
        type: 'string',
        title: '胎儿数',
        ui: { widget: 'number' },
      },
      AMC029: {
        type: 'string',
        title: '生育类型',
        ui: { grid: { span: 6 } },
      },
      AMC031: {
        type: 'string',
        title: '胎次',
        ui: { widget: 'number' },
      },
      BMC031: {
        type: 'string',
        title: '（计划）生育类型',
        ui: { grid: { span: 6 } },
      },

      BMC021: {
        type: 'string',
        title: '生育人员(配偶)姓名',
        ui: { grid: { span: 6 } },
      },
      BMC202: {
        type: 'string',
        title: '生育人员(配偶)身份证号',
        ui: { grid: { span: 6 } },
      },
      AAE010: {
        type: 'string',
        title: '银行卡号',
        ui: { grid: { span: 12 } },
      },
      BAC048: {
        type: 'string',
        title: '转账银行名称',
        ui: { grid: { span: 12 } },
      },
      BAE006: {
        type: 'string',
        title: '开户银行省市',
        ui: { grid: { span: 6 } },
      },
      AAE008: {
        type: 'string',
        title: '开户银行行号',
        ui: { grid: { span: 12 } },
      },
      AAE009: {
        type: 'string',
        title: '银行开户名',
        ui: { grid: { span: 12 } },
      },
    },
    ui: {
      spanLabelFixed: 100,
      grid: { span: 6 },
    },
  };

  bdSchema: SFSchema = {
    properties: {
      AAE013: {
        type: 'string',
        title: '备注',
      },
    },
  };
  //待遇发放信息
  dySchema: SFSchema = {
    properties: {
      SYYLF: {
        type: 'string',
        title: '生育医疗费',
        ui: {
          widget: 'string',
          addOnAfter: '元',
        },
      },
      SYJT: {
        type: 'string',
        title: '生育津贴',
        ui: {
          widget: 'string',
          addOnAfter: '元',
        },
      },
    },
    ui: {
      spanLabelFixed: 100,
      grid: { span: 6 },
    },
  };
  //添加银行网点查询条件
  searchSchema: SFSchema = {
    properties: {
      AAE008: {
        type: 'string',
        title: '发放银行',
        enum: this.supDic.getSFDic('AAE008'),
        ui: {
          widget: 'select',
          allowClear: true,
        },
      },
      AAE118: {
        type: 'string',
        title: '银行网点编码',
      },
      WDMC: {
        type: 'string',
        title: '银行网点名称',
      },
    },
    ui: {
      spanLabelFixed: 120,
      grid: {
        span: 8,
      },
    },
  };

  //添加医疗机构查询条件
  jgsearchSchema: SFSchema = {
    properties: {
      AKB021: {
        type: 'string',
        title: '医疗机构名称',
      },
    },
  };

  tabMode = 'bjxx';
  @ViewChild('sf', { static: false }) sf: SFComponent; //省端信息
  @ViewChild('sf1', { static: false }) sf1: SFComponent; //本地信息
  @ViewChild('sf2', { static: false }) sf2: SFComponent; //计算金额信息
  @ViewChild('sf3', { static: false }) sf3: SFComponent; //银行网点信息
  @ViewChild('sf4', { static: false }) sf4: SFComponent; //医疗机构信息
  @ViewChild('slxx', { static: false }) slxx: SFComponent; //受理信息
  @ViewChild('wjfw', { static: false }) wjfw: LbWjfwComponent;
  @ViewChild('step', { static: true }) step: LbStepsComponent;
  @ViewChild('pzst', { static: false }) pzst: GridComponent;
  @ViewChild('yilg', { static: false }) yilg: GridComponent;
  // 材料查询列表

  clsmcolumns: STColumn[] = [
    { title: '序号', index: 'RN', width: '10%' },
    { title: '材料名称', index: 'STUFFNAME', width: '50%' },
    {
      title: '操作区',
      buttons: [
        {
          text: '打开',
          click: (record: any) => this.open(record),
        },
      ],
    },
    /*{ title: '材料数量', index: 'STUFFNUM', width: '25%' },
    
    { title: '收件类型', index: 'STUFFTYPE', width: '15%' },*/
  ];

  // 银行网点查询列表
  jbColumns: STColumn[] = [
    { title: '银行编码', index: 'AAE008' },
    { title: '发放银行', index: 'NAMECN' },
    { title: '网点编码', index: 'AAE118' },
    { title: '网点名称', index: 'WDMC' },
    {
      title: '操作区',
      buttons: [
        {
          text: '添加',
          click: record => this.tjjb(record),
        },
      ],
    },
  ];
  // 医疗机构查询列表
  JGColumns: STColumn[] = [
    { title: '医疗机构编码', index: 'AKB020' },
    { title: '医疗机构名称', index: 'AKB021' },
    {
      title: '操作区',
      buttons: [
        {
          text: '添加',
          click: record => this.YLJG(record),
        },
      ],
    },
  ];

  page: STPage = {
    show: false,
  };

  constructor(
    private lbservice: HttpService,
    public msgSrv: NzMessageService,
    private supDic: SupDic,
    private reuseTabService: ReuseTabService,
    private activateroute: ActivatedRoute,
  ) {}

  titles() {
    if (this.DAD017 === '67') {
      this.reuseTabService.title = '平产、剖宫产、助娩产待遇核准支付';
    } else if (this.DAD017 === '66') {
      this.reuseTabService.title = '流产、引产、节育、复通手术待遇核准支付';
    } else if (this.DAD017 === '68') {
      this.reuseTabService.title = '未就业配偶医疗待遇';
    }
  }

  sfint() {
    //平产、剖宫产、助娩产待遇核准支付
    if (this.DAD017 === '67') {
      this.sdSchema = {
        properties: {
          AAB301: {
            type: 'string',
            title: '统筹区',
            readOnly: true,
            enum: this.supDic.getSFDic('AAB301'),
            ui: {
              widget: 'select',
            },
          },
          AAC002: {
            type: 'string',
            title: '社会保障号',
            readOnly: true,
          },
          AAC003: {
            type: 'string',
            title: '姓名',
            readOnly: true,
          },
          BMC131: {
            type: 'string',
            title: '生育时间',
            readOnly: true,
            ui: {
              widget: 'date',
              allowClear: true,
              onlyVisual: true,
            },
          },
          AMC029: {
            type: 'string',
            title: '生育类型',
            readOnly: true,
            enum: this.supDic.getSFDic('AMC029'),
            ui: {
              widget: 'select',
            },
          },
          AMC028: {
            type: 'string',
            title: '胎儿数',
            readOnly: true,
            ui: { widget: 'number' },
          },
          AMC031: {
            type: 'string',
            title: '胎次',
            readOnly: true,
            ui: { widget: 'number' },
          },
        },
        ui: {
          spanLabelFixed: 120,
          grid: {
            span: 8,
          },
        },
      };
      this.bdSchema = {
        properties: {
          AAC004: {
            type: 'string',
            title: '性别',
            readOnly: true,
            enum: this.supDic.getSFDic('AAC004'),
            ui: {
              widget: 'select',
            },
          },
          AAB001: {
            type: 'string',
            title: '单位编号',
          },
          AAB004: {
            type: 'string',
            title: '单位名称',
          },

          AAE145: {
            type: 'string',
            title: '支付途径',
            enum: this.supDic.getSFDic('AAE145'),
            ui: {
              onlyVisual: true,
              widget: 'select',
            },
          },

          AKB020: {
            type: 'string',
            title: '医疗机构编码',
            ui: { widget: 'custom' },
          },
          AKB021: {
            type: 'string',
            title: '医疗机构名称',
            readOnly: true,
          },
          AKC201: {
            type: 'string',
            title: '医疗机构类型',
            enum: this.supDic.getSFDic('AKC201'),
            ui: {
              onlyVisual: true,
              widget: 'select',
            },
          },
          AMC002: {
            type: 'string',
            title: '生育类型',
            enum: this.supDic.getSFDic('AMC002'),
            ui: {
              onlyVisual: true,
              widget: 'select',
            },
          },
          AMC032: {
            type: 'string',
            title: '产假天数',
            ui: { onlyVisual: true },
          },
          AMC011: {
            type: 'number',
            title: '生育津贴基数',
            ui: {
              onlyVisual: true,
              widget: 'number',
            },
          },
          AAE008: {
            type: 'string',
            title: '发放银行',
            ui: { onlyVisual: true, widget: 'custom' },
          },
          AAE118: {
            type: 'string',
            title: '银行网点',
            readOnly: true,
          },
          WDMC: {
            type: 'string',
            title: '网点名称',
            readOnly: true,
            ui: {
              grid: { span: 8 },
            },
          },
          AAE010: {
            type: 'string',
            title: '银行卡号',
            ui: {
              onlyVisual: true,
            },
          },
          AAE009: {
            type: 'string',
            title: '银行开户名',
            ui: {
              onlyVisual: true,
            },
          },
          SFYDZR: {
            type: 'string',
            title: '是否异地转入',
            enum: this.supDic.getSFDic('YESNO'),
            ui: {
              widget: 'select',
            },
          },
          AAE013: {
            type: 'string',
            title: '备注',
            ui: { grid: { span: 8 } },
          },
        },
        required: [
          'AMC011',
          'AMC012',
          'AKC201',
          'AMC038',
          'AMC041',
          'AMC002',
          'AAE145',
          'AMC032',
          'AAE008',
          'AAE010',
          'AAE009',
        ],
        ui: {
          spanLabelFixed: 120,
          grid: {
            span: 8,
          },
        },
      };
    } //流产、引产、节育、复通手术待遇核准支付
    else if (this.DAD017 === '66') {
      this.sdSchema = {
        properties: {
          AAB301: {
            type: 'string',
            title: '统筹区',
            readOnly: true,
            enum: this.supDic.getSFDic('AAB301'),
            ui: {
              widget: 'select',
            },
          },
          AAC002: {
            type: 'string',
            title: '社会保障号',
            readOnly: true,
          },
          AAC003: {
            type: 'string',
            title: '姓名',
            readOnly: true,
          },
          BMC131: {
            type: 'string',
            title: '计划生育时间',
            readOnly: true,
            ui: {
              widget: 'date',
            },
          },
          BMC132: {
            type: 'string',
            title: '末次月经时间',
            readOnly: true,
            ui: {
              widget: 'date',
            },
          },
          BMC030: {
            type: 'string',
            title: '计划生育类别 ',
            readOnly: true,
            enum: this.supDic.getSFDic('BMC030'),
          },
        },
        ui: {
          spanLabelFixed: 120,
          grid: {
            span: 8,
          },
        },
      };
      this.bdSchema = {
        properties: {
          AAC004: {
            type: 'string',
            title: '性别',
            readOnly: true,
            enum: this.supDic.getSFDic('AAC004'),
            ui: {
              widget: 'select',
            },
          },
          AAB001: {
            type: 'string',
            title: '单位编号',
          },
          AAB004: {
            type: 'string',
            title: '单位名称',
          },

          AAE145: {
            type: 'string',
            title: '支付途径',
            enum: this.supDic.getSFDic('AAE145'),
            ui: {
              onlyVisual: true,
              widget: 'select',
            },
          },
          AKB020: {
            type: 'string',
            title: '医疗机构编码',
            ui: { widget: 'custom' },
          },
          AKB021: {
            type: 'string',
            title: '医疗机构名称',
            readOnly: true,
          },
          AKC201: {
            type: 'string',
            title: '医疗机构类型',
            enum: this.supDic.getSFDic('AKC201'),
            ui: {
              onlyVisual: true,
              widget: 'select',
            },
          },
          AMC002: {
            type: 'string',
            title: '生育类型',
            enum: this.supDic.getSFDic('AMC002'),
            ui: {
              onlyVisual: true,
              widget: 'select',
            },
          },
          AMC032: {
            type: 'string',
            title: '产假天数',
            ui: {
              onlyVisual: true,
            },
          },
          AMC011: {
            type: 'number',
            title: '生育津贴基数',
            ui: {
              onlyVisual: true,
              widget: 'number',
            },
          },
          AAE008: {
            type: 'string',
            title: '发放银行',
            ui: {
              onlyVisual: true,
              widget: 'custom',
            },
          },
          AAE118: {
            type: 'string',
            title: '银行网点',
            readOnly: true,
          },

          WDMC: {
            type: 'string',
            title: '网点名称',
            readOnly: true,
            ui: {
              grid: { span: 8 },
            },
          },
          AAE010: {
            type: 'string',
            title: '银行卡号',
            ui: {
              onlyVisual: true,
            },
          },
          AAE009: {
            type: 'string',
            title: '银行开户名',
            ui: {
              onlyVisual: true,
            },
          },
          SFYDZR: {
            type: 'string',
            title: '是否异地转入',
            enum: this.supDic.getSFDic('YESNO'),
            ui: {
              widget: 'select',
            },
          },
          AAE013: {
            type: 'string',
            title: '备注',
          },
        },
        required: [
          'AMC011',
          'AMC012',
          'AKC201',
          'AMC038',
          'AMC041',
          'AMC002',
          'AMC032',
          'AAE145',
          'AAE008',
          'AAE010',
          'AAE009',
        ],

        ui: {
          spanLabelFixed: 120,
          grid: {
            span: 8,
          },
        },
      };
    } //未就业配偶医疗待遇核准支付
    else if (this.DAD017 === '68') {
      this.sdSchema = {
        properties: {
          AAB301: {
            type: 'string',
            title: '统筹区',
            readOnly: true,
            enum: this.supDic.getSFDic('AAB301'),
            ui: {
              widget: 'select',
            },
          },
          AAC002: {
            type: 'string',
            title: '社会保障号',
            readOnly: true,
          },
          AAC003: {
            type: 'string',
            title: '姓名',
            readOnly: true,
          },
          BMC131: {
            type: 'string',
            title: '生育时间',
            readOnly: true,
            ui: {
              widget: 'date',
            },
          },
          BMC031: {
            type: 'string',
            title: '计划生育类别 ',
            readOnly: true,
            enum: this.supDic.getSFDic('BMC031'),
            ui: {
              widget: 'select',
            },
          },
          BMC132: {
            type: 'string',
            title: '末次月经时间',
            readOnly: true,
            ui: {
              widget: 'date',
            },
          },
          AMC031: {
            type: 'string',
            title: '胎次',
            readOnly: true,
            ui: {
              widget: 'number',
            },
          },
          BMC202: {
            type: 'string',
            title: '配偶身份证',
            readOnly: true,
          },
          BMC021: {
            type: 'string',
            title: '配偶姓名',
            readOnly: true,
          },
          AGA001: {
            type: 'string',
            title: '申报号',
            readOnly: true,
          },
        },
        ui: {
          spanLabelFixed: 120,
          grid: {
            span: 8,
          },
        },
      };
      this.bdSchema = {
        properties: {
          AAC004: {
            type: 'string',
            title: '性别',
            readOnly: true,
            enum: this.supDic.getSFDic('AAC004'),
          },
          AAE145: {
            type: 'string',
            title: '支付途径',
            enum: this.supDic.getSFDic('AAE145'),
            ui: {
              onlyVisual: true,
              widget: 'select',
            },
          },

          AKB020: {
            type: 'string',
            title: '医疗机构编码',
            ui: { widget: 'custom' },
          },
          AKB021: {
            type: 'string',
            title: '医疗机构名称',
            readOnly: true,
          },
          AKC201: {
            type: 'string',
            title: '医疗机构类型',
            enum: this.supDic.getSFDic('AKC201'),
            ui: { onlyVisual: true, widget: 'select' },
          },
          AMC002: {
            type: 'string',
            title: '生育类型',
            enum: this.supDic.getSFDic('AMC002'),
            ui: {
              onlyVisual: true,
              widget: 'select',
            },
          },

          AMC041: {
            type: 'string',
            title: '医疗总金额',
            ui: { onlyVisual: true, widget: 'number' },
          },
          AMC038: {
            type: 'string',
            title: '医疗剔除金额',
            ui: { onlyVisual: true, widget: 'number' },
          },
          AAE008: {
            type: 'string',
            title: '发放银行',
            ui: { onlyVisual: true, widget: 'custom' },
          },
          AAE118: {
            type: 'string',
            title: '银行网点',
            readOnly: true,
          },

          WDMC: {
            type: 'string',
            title: '网点名称',
            readOnly: true,
            ui: {
              grid: { span: 8 },
            },
          },
          AAE010: {
            type: 'string',
            title: '银行卡号',
            ui: {
              onlyVisual: true,
            },
          },
          AAE009: {
            type: 'string',
            title: '银行开户名',
            ui: {
              onlyVisual: true,
            },
          },
          AMC013: {
            type: 'string',
            title: '住院日期',
            ui: {
              widget: 'date',
            },
          },
          AMC014: {
            type: 'string',
            title: '出院日期',
            ui: {
              widget: 'date',
            },
          },
          AAE013: {
            type: 'string',
            title: '备注',
            ui: { grid: { span: 12 } },
          },
          AMC011: {
            type: 'string',
            title: '生育津贴基数',
            readOnly: true,
          },
        },
        required: [
          'AMC012',
          'AKC201',
          'AMC038',
          'AMC041',
          'AMC002',
          'AAE145',
          'AAE008',
          'AAE010',
          'AAE009',
        ],
        ui: {
          spanLabelFixed: 120,
          grid: {
            span: 8,
          },
        },
      };
    }
  }

  ngOnInit() {
    if (this.activateroute.snapshot.queryParams.PROJID) {
      this.PROJID = this.activateroute.snapshot.queryParams.PROJID;
      this.DAD069 = this.activateroute.snapshot.queryParams.DAD069;
      this.DAD017 = this.activateroute.snapshot.queryParams.DAD017;
      this.titles();
      this.sfint();
      this.YB_QUERY();
      this.YBCL_QUERY();
    }
  }

  //打开情况下再次传入值
  _onReuseInit(): void {
    if (this.activateroute.snapshot.queryParams.PROJID) {
      this.PROJID = this.activateroute.snapshot.queryParams.PROJID;
      this.DAD069 = this.activateroute.snapshot.queryParams.DAD069;
      this.DAD017 = this.activateroute.snapshot.queryParams.DAD017;
      this.sfint();
      this.titles();
      this.YB_QUERY();
      this.YBCL_QUERY();
    }
  }

  //事项进度
  selectTab(str: string) {
    this.tabMode = str;
    if (str === 'sxjd') {
    }
  }

  //获取省端数据
  YB_QUERY() {
    this.lbservice
      .lbservice('YB_QUERY', { para: { PROJID: this.PROJID } })
      .then(resdata => {
        if (resdata.code < 1) {
          this.msgSrv.error(resdata.errmsg);
        } else {
          this.sf.formData = JSON.parse(resdata.message);
          this.sf.reset();
          this.BDINT_QUERY();
          this.Syjtjs();
        }
      });
  }

  //本地数据的查询
  BDINT_QUERY() {
    this.lbservice
      .lbservice('SYBDINT_QUERY', { para: { sf: this.sf.value } })
      .then(resdata => {
        if (resdata.code < 1) {
          this.msgSrv.error(resdata.errmsg);
        } else {
          this.sf1.formData = resdata.message.list[0];
          this.sf1.reset();
        }
      });
  }

  //材料列表
  YBCL_QUERY() {
    this.lbservice
      .lbservice('YBCLSM_QUERY', {
        para: { PROJID: this.PROJID, FLAG: '2' },
      })
      .then(resdata => {
        if (resdata.code === 0) {
          this.msgSrv.error(resdata.errmsg);
        } else {
          this.dataset = resdata.message.list;
        }
      });
  }

  //受理保存
  wjy_insert() {
    this.lbservice
      .lbservice('wjy_insert', {
        para: {
          PROJID: this.PROJID,
          sf: this.sf.value,
          sf1: this.sf1.value,
          sf2: this.sf2.value,
          slxx: this.slxx.value,
        },
      })
      .then(resdata => {
        if (this.sf1.valid == true && this.sf.valid == true) {
          if (resdata.code < 1) {
            this.msgSrv.error(resdata.errmsg);
          } else {
            this.msgSrv.info('保存成功');
          }
        } else {
          //事项受理时必填  不予受理时不需要必填
          if (this.slxx.value.DAD095 == '1') {
            this.msgSrv.info('必填项请填写');
          } else {
            if (resdata.code < 1) {
              this.msgSrv.error(resdata.errmsg);
            } else {
              this.msgSrv.info('该事项已不予受理');
            }
          }
        }
        //保存后数据清空
        this.sf.formData = null;
        this.slxx.formData = null;
        this.sf1.formData = null;
        this.sf2.formData = null;
        this.slxx.reset();
        this.sf.reset();
        this.sf1.reset();
        this.sf2.reset();
      });
  }

  //待遇计算
  dyjs_insert() {
    this.lbservice
      .lbservice('dyjs_insert', {
        para: {
          PROJID: this.PROJID,
          DAD017: this.DAD017,
          sf: this.sf.value,
          sf1: this.sf1.value,
          slxx: this.slxx.value,
        },
      })
      .then(resdata => {
        if (this.sf1.valid == true && this.sf.valid == true) {
          if (resdata.code < 1) {
            this.msgSrv.error(resdata.errmsg);
          } else {
            this.msgSrv.info('计算完成，请核对金额');
            this.sf2.formData = resdata.message;
            this.sf2.reset();
          }
        } else {
          this.msgSrv.info('必填项请填写');
        }
      });
  }
  handlePzCancel() {
    this.isPzVisible = false;
  }

  //添加银行网点字典
  JbAdd() {
    this.sf1.setValue('/AAE008', null);
    this.pzst.reload({});
    this.isPzVisible = true;
  }
  //页面赋值
  tjjb(rec) {
    this.sf1.setValue('/AAE008', rec.AAE008);
    this.sf1.setValue('/AAE118', rec.AAE118);
    this.sf1.setValue('/WDMC', rec.WDMC);
    this.isPzVisible = false;
  }
  // 银行网点查询
  yp_query() {
    this.lbservice
      .lbservice('WD_QUERY', {
        para: { sf3: this.sf3.value },
      })
      .then(resdata => {
        this.date2 = resdata.message.list;
      });
  }
  //添加医疗机构
  handlePzCancel1() {
    this.isPzVisible1 = false;
  }
  YLJGAdd() {
    this.sf1.setValue('/AKB020', null);
    this.yilg.reload({});
    this.isPzVisible1 = true;
  }
  //页面赋值
  YLJG(rec) {
    this.sf1.setValue('/AKB020', rec.AKB020);
    this.sf1.setValue('/AKB021', rec.AKB021);
    this.isPzVisible1 = false;
  }
  //调用查询过程
  yljg_query() {
    this.lbservice
      .lbservice('yljg_query', {
        para: { sf4: this.sf4.value },
      })
      .then(resdata => {
        this.date3 = resdata.message.list;
      });
  }

  //生育类型的改变   生育津贴天数改变(AMC032)
  formChange1(para: any) {
    if (para.AMC002 !== undefined) {
      this.LS_DAD017 = this.activateroute.snapshot.queryParams.DAD017;
      // debugger;
      if (para.AMC002 != this.old_AMC002) {
        this.old_AMC002 = para.AMC002;
        this.syjt();
      }
    }
  }

  //获取生育津贴天数
  syjt() {
    this.lbservice
      .lbservice('Syjt_insert', {
        para: {
          sf: this.sf.value,
          sf1: this.sf1.value,
        },
      })
      .then(resdata => {
        if (resdata.code < 1) {
          this.msgSrv.error(resdata.errmsg);
        } else {
          this.sf1.setValue('/AMC032', resdata.message.AMC032);
        }
      });
  }
  //自动获取生育津贴基数
  Syjtjs() {
    this.lbservice
      .lbservice('Syjtjs_QUERY', {
        para: {
          sf: this.sf.value,
          sf1: this.sf1.value,
        },
      })
      .then(resdata => {
        if (resdata.code < 1) {
          this.msgSrv.error(resdata.errmsg);
        } else {
          this.sf1.setValue('/AMC011', resdata.message.AMC011);
        }
      });
  }
  open(recode: any) {
    if (recode.ATTACHPATH !== '无') {
      window.open(recode.ATTACHPATH);
    } else {
      alert('不存在文件地址');
    }
  }
  // tslint:disable-next-line:all
  pname = '省端传入数据';
  // tslint:disable-next-line: member-ordering
  active = true;
  // tslint:disable-next-line: member-ordering
  icon = 'double-right';
  // tslint:disable-next-line: member-ordering
  pname1 = '本地业务数据';
  // tslint:disable-next-line: member-ordering
  active1 = true;
  // tslint:disable-next-line: member-ordering
  icon1 = 'caret-right';
  // tslint:disable-next-line: member-ordering
  pname2 = '待遇信息';
  // tslint:disable-next-line: member-ordering
  active2 = true;
  // tslint:disable-next-line: member-ordering
  modalPzTitle = '银行网点';
  // tslint:disable-next-line: member-ordering
  modalPzTitle1 = '医疗机构名称';
}
